package common


/**
 * BootstrapTagLib
 * A taglib library provides a set of reusable tags to help rendering the views.
 */
class BootstrapTagLib {
	static namespace = "bootstrap"
	
	
	def fixedNavBar = { attrs, body ->
		def theme = attrs.theme ? "/themes/${attrs.theme}" : "/themes/default";
		
		def ngBind           = attrs.ngBind;
		def ngBindHtmlUnsafe = attrs.ngBindHtmlUnsafe;
		def ngBindTemplate   = attrs.ngBindTemplate;
		def ngChange         = attrs.ngChange;
		def ngClass          = attrs.ngClass;
		def ngClassEven      = attrs.ngClassEven;
		def ngClassOdd       = attrs.ngClassOdd;
		def ngClick          = attrs.ngClick;
		
		def ngController     = attrs.ngController;
		def ngCsp            = attrs.ngCsp;
		
		def ngDblClick       = attrs.ngDblClick;
		
		
		def ngDisabled       = attrs.ngDisabled
		def ngForm           = attrs.ngForm
		def ngHide           = attrs.ngHide
		def ngHref           = attrs.ngHref;
		def ngInclude        = attrs.ngInclude
		def ngInit           = attrs.ngInit
		def ngList           = attrs.ngList
		def ngModel          = attrs.ngModel
		def ngMousedown      = attrs.ngMousedown
		def ngMouseenter     = attrs.ngMouseenter
		def ngMouseleave     = attrs.ngMouseleave
		def ngMousemove      = attrs.ngMousemove
		def ngMouseover      = attrs.ngMouseover
		def ngMouseup        = attrs.ngMouseup
		def ngMultiple       = attrs.ngMultiple
		def ngNonBindable    = attrs.ngNonBindable
		def ngPluralize      = attrs.ngPluralize
		def ngReadonly       = attrs.ngReadonly
		def ngRepeat         = attrs.ngRepeat
		def ngSelected       = attrs.ngSelected
		def ngShow           = attrs.ngShow
		def ngSrc            = attrs.ngSrc
		def ngStyle          = attrs.ngStyle
		def ngSubmit         = attrs.ngSubmit
		def ngSwitch         = attrs.ngSwitch
		def ngTransclude     = attrs.ngTransclude
		def ngView           = attrs.ngView

		 
		out << render(template: "${theme}/ui/fixedNavbar", model: [id: attrs.id, insideBody: body,
			ngBind           : ngBind,
			ngBindHtmlUnsafe : ngBindHtmlUnsafe,
			ngBindTemplate   : ngBindTemplate,
			ngChange         : ngChange,
			ngClass          : ngClass,
			ngClassEven      : ngClassEven,
			ngClassOdd       : ngClassOdd,
			ngClick          : ngClick,
			
			ngController     : ngController,
			ngCsp            : ngCsp,
			
			ngDblClick       : ngDblClick,
			
			
			ngDisabled       : ngDisabled,
			ngForm           : ngForm,
			ngHide           : ngHide,
			ngHref           : ngHref,
			ngInclude        : ngInclude,
			ngInit           : ngInit,
			ngList           : ngList,
			ngModel          : ngModel,
			ngMousedown      : ngMousedown,
			ngMouseenter     : ngMouseenter,
			ngMouseleave     : ngMouseleave,
			ngMousemove      : ngMousemove,
			ngMouseover      : ngMouseover,
			ngMouseup        : ngMouseup,
			ngMultiple       : ngMultiple,
			ngNonBindable    : ngNonBindable,
			ngPluralize      : ngPluralize,
			ngReadonly       : ngReadonly,
			ngRepeat         : ngRepeat,
			ngSelected       : ngSelected,
			ngShow           : ngShow,
			ngSrc            : ngSrc,
			ngStyle          : ngStyle,
			ngSubmit         : ngSubmit,
			ngSwitch         : ngSwitch,
			ngTransclude     : ngTransclude,
			ngView           : ngView

			])
	}
	
	
	def logo = { attrs, body ->
		
		def theme = attrs.theme ? "/themes/${attrs.theme}" : "/themes/default";
		
		def v_title   = attrs.title ? attrs.title : "${meta(name:'app.name')}"
		def v_version = attrs.version ? attrs.version : " - a${meta(name:'app.version')}"

		
		def ngBind           = attrs.ngBind;
		def ngBindHtmlUnsafe = attrs.ngBindHtmlUnsafe;
		def ngBindTemplate   = attrs.ngBindTemplate;
		def ngChange         = attrs.ngChange;
		def ngClass          = attrs.ngClass;
		def ngClassEven      = attrs.ngClassEven;
		def ngClassOdd       = attrs.ngClassOdd;
		def ngClick          = attrs.ngClick;
		
		def ngController     = attrs.ngController;
		def ngCsp            = attrs.ngCsp;
		
		def ngDblClick       = attrs.ngDblClick;
		
		
		def ngDisabled       = attrs.ngDisabled
		def ngForm           = attrs.ngForm
		def ngHide           = attrs.ngHide
		def ngHref           = attrs.ngHref;
		def ngInclude        = attrs.ngInclude
		def ngInit           = attrs.ngInit
		def ngList           = attrs.ngList
		def ngModel          = attrs.ngModel
		def ngMousedown      = attrs.ngMousedown
		def ngMouseenter     = attrs.ngMouseenter
		def ngMouseleave     = attrs.ngMouseleave
		def ngMousemove      = attrs.ngMousemove
		def ngMouseover      = attrs.ngMouseover
		def ngMouseup        = attrs.ngMouseup
		def ngMultiple       = attrs.ngMultiple
		def ngNonBindable    = attrs.ngNonBindable
		def ngPluralize      = attrs.ngPluralize
		def ngReadonly       = attrs.ngReadonly
		def ngRepeat         = attrs.ngRepeat
		def ngSelected       = attrs.ngSelected
		def ngShow           = attrs.ngShow
		def ngSrc            = attrs.ngSrc
		def ngStyle          = attrs.ngStyle
		def ngSubmit         = attrs.ngSubmit
		def ngSwitch         = attrs.ngSwitch
		def ngTransclude     = attrs.ngTransclude
		def ngView           = attrs.ngView

		out << render(template: "${theme}/ui/logo", model: [id: attrs.id, insideBody: body, title:v_title, version: v_version,
			ngBind           : ngBind,
			ngBindHtmlUnsafe : ngBindHtmlUnsafe,
			ngBindTemplate   : ngBindTemplate,
			ngChange         : ngChange,
			ngClass          : ngClass,
			ngClassEven      : ngClassEven,
			ngClassOdd       : ngClassOdd,
			ngClick          : ngClick,
			
			ngController     : ngController,
			ngCsp            : ngCsp,
			
			ngDblClick       : ngDblClick,
			
			
			ngDisabled       : ngDisabled,
			ngForm           : ngForm,
			ngHide           : ngHide,
			ngHref           : ngHref,
			ngInclude        : ngInclude,
			ngInit           : ngInit,
			ngList           : ngList,
			ngModel          : ngModel,
			ngMousedown      : ngMousedown,
			ngMouseenter     : ngMouseenter,
			ngMouseleave     : ngMouseleave,
			ngMousemove      : ngMousemove,
			ngMouseover      : ngMouseover,
			ngMouseup        : ngMouseup,
			ngMultiple       : ngMultiple,
			ngNonBindable    : ngNonBindable,
			ngPluralize      : ngPluralize,
			ngReadonly       : ngReadonly,
			ngRepeat         : ngRepeat,
			ngSelected       : ngSelected,
			ngShow           : ngShow,
			ngSrc            : ngSrc,
			ngStyle          : ngStyle,
			ngSubmit         : ngSubmit,
			ngSwitch         : ngSwitch,
			ngTransclude     : ngTransclude,
			ngView           : ngView

			])
	}
	
	
	def searchBox = { attrs, body ->
		def theme = attrs.theme ? "/themes/${attrs.theme}" : "/themes/default";
		def searchboxCtrl = attrs.searchboxCtrl ? attrs.searchboxCtrl : "SearchboxCtrl";
		def placeholderText = attrs.placeholderText ? attrs.placeholderText : "Procurar ...";
		
		def ngBind           = attrs.ngBind;
		def ngBindHtmlUnsafe = attrs.ngBindHtmlUnsafe;
		def ngBindTemplate   = attrs.ngBindTemplate;
		def ngChange         = attrs.ngChange;
		def ngClass          = attrs.ngClass;
		def ngClassEven      = attrs.ngClassEven;
		def ngClassOdd       = attrs.ngClassOdd;
		def ngClick          = attrs.ngClick;
		
		def ngController     = attrs.ngController;
		def ngCsp            = attrs.ngCsp;
		
		def ngDblClick       = attrs.ngDblClick;
		
		
		def ngDisabled       = attrs.ngDisabled
		def ngForm           = attrs.ngForm
		def ngHide           = attrs.ngHide
		def ngHref           = attrs.ngHref;
		def ngInclude        = attrs.ngInclude
		def ngInit           = attrs.ngInit
		def ngList           = attrs.ngList
		def ngModel          = attrs.ngModel
		def ngMousedown      = attrs.ngMousedown
		def ngMouseenter     = attrs.ngMouseenter
		def ngMouseleave     = attrs.ngMouseleave
		def ngMousemove      = attrs.ngMousemove
		def ngMouseover      = attrs.ngMouseover
		def ngMouseup        = attrs.ngMouseup
		def ngMultiple       = attrs.ngMultiple
		def ngNonBindable    = attrs.ngNonBindable
		def ngPluralize      = attrs.ngPluralize
		def ngReadonly       = attrs.ngReadonly
		def ngRepeat         = attrs.ngRepeat
		def ngSelected       = attrs.ngSelected
		def ngShow           = attrs.ngShow
		def ngSrc            = attrs.ngSrc
		def ngStyle          = attrs.ngStyle
		def ngSubmit         = attrs.ngSubmit
		def ngSwitch         = attrs.ngSwitch
		def ngTransclude     = attrs.ngTransclude
		def ngView           = attrs.ngView

		 
		out << render(template: "${theme}/ui/searchBox", model: [id: attrs.id, 
			                                                     cssClasses : attrs.cssClasses,
																 searchboxCtrl : searchboxCtrl,
																 placeholderText : placeholderText,
	
																 ngBind           : ngBind,
																 ngBindHtmlUnsafe : ngBindHtmlUnsafe,
																 ngBindTemplate   : ngBindTemplate,
																 ngChange         : ngChange,
																 ngClass          : ngClass,
																 ngClassEven      : ngClassEven,
																 ngClassOdd       : ngClassOdd,
																 ngClick          : ngClick,
																 
																 ngController     : ngController,
																 ngCsp            : ngCsp,
																 
																 ngDblClick       : ngDblClick,
																 
																 
																 ngDisabled       : ngDisabled,
																 ngForm           : ngForm,
																 ngHide           : ngHide,
																 ngHref           : ngHref,
																 ngInclude        : ngInclude,
																 ngInit           : ngInit,
																 ngList           : ngList,
																 ngModel          : ngModel,
																 ngMousedown      : ngMousedown,
																 ngMouseenter     : ngMouseenter,
																 ngMouseleave     : ngMouseleave,
																 ngMousemove      : ngMousemove,
																 ngMouseover      : ngMouseover,
																 ngMouseup        : ngMouseup,
																 ngMultiple       : ngMultiple,
																 ngNonBindable    : ngNonBindable,
																 ngPluralize      : ngPluralize,
																 ngReadonly       : ngReadonly,
																 ngRepeat         : ngRepeat,
																 ngSelected       : ngSelected,
																 ngShow           : ngShow,
																 ngSrc            : ngSrc,
																 ngStyle          : ngStyle,
																 ngSubmit         : ngSubmit,
																 ngSwitch         : ngSwitch,
																 ngTransclude     : ngTransclude,
																 ngView           : ngView
	 
			                                                    ])
	}
	
	
	
	def dropDown = { attrs, body ->
		
		def theme = attrs.theme ? "/themes/${attrs.theme}" : "/themes/default";
		
		def dropdownCtrl = attrs.ngController;

		
		def ngBind           = attrs.ngBind;
		def ngBindHtmlUnsafe = attrs.ngBindHtmlUnsafe;
		def ngBindTemplate   = attrs.ngBindTemplate;
		def ngChange         = attrs.ngChange;
		def ngClass          = attrs.ngClass;
		def ngClassEven      = attrs.ngClassEven;
		def ngClassOdd       = attrs.ngClassOdd;
		def ngClick          = attrs.ngClick;
		
		def ngController     = attrs.ngController;
		def ngCsp            = attrs.ngCsp;
		
		def ngDblClick       = attrs.ngDblClick;
		
		
		def ngDisabled       = attrs.ngDisabled
		def ngForm           = attrs.ngForm
		def ngHide           = attrs.ngHide
		def ngHref           = attrs.ngHref;
		def ngInclude        = attrs.ngInclude
		def ngInit           = attrs.ngInit
		def ngList           = attrs.ngList
		def ngModel          = attrs.ngModel
		def ngMousedown      = attrs.ngMousedown
		def ngMouseenter     = attrs.ngMouseenter
		def ngMouseleave     = attrs.ngMouseleave
		def ngMousemove      = attrs.ngMousemove
		def ngMouseover      = attrs.ngMouseover
		def ngMouseup        = attrs.ngMouseup
		def ngMultiple       = attrs.ngMultiple
		def ngNonBindable    = attrs.ngNonBindable
		def ngPluralize      = attrs.ngPluralize
		def ngReadonly       = attrs.ngReadonly
		def ngRepeat         = attrs.ngRepeat
		def ngSelected       = attrs.ngSelected
		def ngShow           = attrs.ngShow
		def ngSrc            = attrs.ngSrc
		def ngStyle          = attrs.ngStyle
		def ngSubmit         = attrs.ngSubmit
		def ngSwitch         = attrs.ngSwitch
		def ngTransclude     = attrs.ngTransclude
		def ngView           = attrs.ngView

		out << render(template: "${theme}/ui/dropDown", model: [
			                                                     id: attrs.id, 
																 icon: attrs.icon, 
																 href: attrs.href, 
																 title: attrs.title , 
																 insideBody: body,
																 dropdownCtrl : dropdownCtrl,
																 
																 ngBind           : ngBind,
																 ngBindHtmlUnsafe : ngBindHtmlUnsafe,
																 ngBindTemplate   : ngBindTemplate,
																 ngChange         : ngChange,
																 ngClass          : ngClass,
																 ngClassEven      : ngClassEven,
																 ngClassOdd       : ngClassOdd,
																 ngClick          : ngClick,
																 
																 ngController     : ngController,
																 ngCsp            : ngCsp,
																 
																 ngDblClick       : ngDblClick,
																 
																 
																 ngDisabled       : ngDisabled,
																 ngForm           : ngForm,
																 ngHide           : ngHide,
																 ngHref           : ngHref,
																 ngInclude        : ngInclude,
																 ngInit           : ngInit,
																 ngList           : ngList,
																 ngModel          : ngModel,
																 ngMousedown      : ngMousedown,
																 ngMouseenter     : ngMouseenter,
																 ngMouseleave     : ngMouseleave,
																 ngMousemove      : ngMousemove,
																 ngMouseover      : ngMouseover,
																 ngMouseup        : ngMouseup,
																 ngMultiple       : ngMultiple,
																 ngNonBindable    : ngNonBindable,
																 ngPluralize      : ngPluralize,
																 ngReadonly       : ngReadonly,
																 ngRepeat         : ngRepeat,
																 ngSelected       : ngSelected,
																 ngShow           : ngShow,
																 ngSrc            : ngSrc,
																 ngStyle          : ngStyle,
																 ngSubmit         : ngSubmit,
																 ngSwitch         : ngSwitch,
																 ngTransclude     : ngTransclude,
																 ngView           : ngView
	 
															   ])
	}
	
	
	def dropDownItem = { attrs, body ->
		
		def theme = attrs.theme ? "/themes/${attrs.theme}" : "/themes/default";
		
		def htmlId   = attrs.htmlId;
		def cssClass = attrs.cssClass;
		def licssClass = attrs.cssClass;
		def href     = attrs.href;
		def icon     = attrs.icon;

		def ngBind           = attrs.ngBind;
		def ngBindHtmlUnsafe = attrs.ngBindHtmlUnsafe;
		def ngBindTemplate   = attrs.ngBindTemplate;
		def ngChange         = attrs.ngChange;
		def ngClass          = attrs.ngClass;
		def ngClassEven      = attrs.ngClassEven;
		def ngClassOdd       = attrs.ngClassOdd;
		def ngClick          = attrs.ngClick;
		
		def ngController     = attrs.ngController;
		def ngCsp            = attrs.ngCsp;
		
		def ngDblClick       = attrs.ngDblClick;
		
		
		def ngDisabled       = attrs.ngDisabled
		def ngForm           = attrs.ngForm
		def ngHide           = attrs.ngHide
		def ngHref           = attrs.ngHref;
		def ngInclude        = attrs.ngInclude
		def ngInit           = attrs.ngInit
		def ngList           = attrs.ngList
		def ngModel          = attrs.ngModel
		def ngMousedown      = attrs.ngMousedown
		def ngMouseenter     = attrs.ngMouseenter
		def ngMouseleave     = attrs.ngMouseleave
		def ngMousemove      = attrs.ngMousemove
		def ngMouseover      = attrs.ngMouseover
		def ngMouseup        = attrs.ngMouseup
		def ngMultiple       = attrs.ngMultiple
		def ngNonBindable    = attrs.ngNonBindable
		def ngPluralize      = attrs.ngPluralize
		def ngReadonly       = attrs.ngReadonly
		def ngRepeat         = attrs.ngRepeat
		def ngSelected       = attrs.ngSelected
		def ngShow           = attrs.ngShow
		def ngSrc            = attrs.ngSrc
		def ngStyle          = attrs.ngStyle
		def ngSubmit         = attrs.ngSubmit
		def ngSwitch         = attrs.ngSwitch
		def ngTransclude     = attrs.ngTransclude
		def ngView           = attrs.ngView

		
		out << render(template: "${theme}/ui/dropDownItem", model: [

																	id: htmlId,
																	cssClass: cssClass,
																	licssClass : licssClass,
																	href : href,
																	icon : icon,
																	text : body,
																ngBind           : ngBind,
															ngBindHtmlUnsafe : ngBindHtmlUnsafe,
															ngBindTemplate   : ngBindTemplate,
															ngChange         : ngChange,
															ngClass          : ngClass,
															ngClassEven      : ngClassEven,
															ngClassOdd       : ngClassOdd,
															ngClick          : ngClick,
															
															ngController     : ngController,
															ngCsp            : ngCsp,
															
															ngDblClick       : ngDblClick,
															
															
															ngDisabled       : ngDisabled,
															ngForm           : ngForm,
															ngHide           : ngHide,
															ngHref           : ngHref,
															ngInclude        : ngInclude,
															ngInit           : ngInit,
															ngList           : ngList,
															ngModel          : ngModel,
															ngMousedown      : ngMousedown,
															ngMouseenter     : ngMouseenter,
															ngMouseleave     : ngMouseleave,
															ngMousemove      : ngMousemove,
															ngMouseover      : ngMouseover,
															ngMouseup        : ngMouseup,
															ngMultiple       : ngMultiple,
															ngNonBindable    : ngNonBindable,
															ngPluralize      : ngPluralize,
															ngReadonly       : ngReadonly,
															ngRepeat         : ngRepeat,
															ngSelected       : ngSelected,
															ngShow           : ngShow,
															ngSrc            : ngSrc,
															ngStyle          : ngStyle,
															ngSubmit         : ngSubmit,
															ngSwitch         : ngSwitch,
															ngTransclude     : ngTransclude,
															ngView           : ngView


																	])
	}

	def dropDownSeparator = { attrs, body ->
		def theme = attrs.theme ? "/themes/${attrs.theme}" : "/themes/default";

		def htmlId   = attrs.htmlId;
		def cssClass = attrs.cssClass;

		def ngBind           = attrs.ngBind;
		def ngBindHtmlUnsafe = attrs.ngBindHtmlUnsafe;
		def ngBindTemplate   = attrs.ngBindTemplate;
		def ngChange         = attrs.ngChange;
		def ngClass          = attrs.ngClass;
		def ngClassEven      = attrs.ngClassEven;
		def ngClassOdd       = attrs.ngClassOdd;
		def ngClick          = attrs.ngClick;
		
		def ngController     = attrs.ngController;
		def ngCsp            = attrs.ngCsp;
		
		def ngDblClick       = attrs.ngDblClick;
		
		
		def ngDisabled       = attrs.ngDisabled
		def ngForm           = attrs.ngForm
		def ngHide           = attrs.ngHide
		def ngHref           = attrs.ngHref;
		def ngInclude        = attrs.ngInclude
		def ngInit           = attrs.ngInit
		def ngList           = attrs.ngList
		def ngModel          = attrs.ngModel
		def ngMousedown      = attrs.ngMousedown
		def ngMouseenter     = attrs.ngMouseenter
		def ngMouseleave     = attrs.ngMouseleave
		def ngMousemove      = attrs.ngMousemove
		def ngMouseover      = attrs.ngMouseover
		def ngMouseup        = attrs.ngMouseup
		def ngMultiple       = attrs.ngMultiple
		def ngNonBindable    = attrs.ngNonBindable
		def ngPluralize      = attrs.ngPluralize
		def ngReadonly       = attrs.ngReadonly
		def ngRepeat         = attrs.ngRepeat
		def ngSelected       = attrs.ngSelected
		def ngShow           = attrs.ngShow
		def ngSrc            = attrs.ngSrc
		def ngStyle          = attrs.ngStyle
		def ngSubmit         = attrs.ngSubmit
		def ngSwitch         = attrs.ngSwitch
		def ngTransclude     = attrs.ngTransclude
		def ngView           = attrs.ngView

		out << render(template: "${theme}/ui/dropdownSeparator", model: [

                                                                  id: htmlId,
															cssClass: cssClass,
															ngBind           : ngBind,
															ngBindHtmlUnsafe : ngBindHtmlUnsafe,
															ngBindTemplate   : ngBindTemplate,
															ngChange         : ngChange,
															ngClass          : ngClass,
															ngClassEven      : ngClassEven,
															ngClassOdd       : ngClassOdd,
															ngClick          : ngClick,
															
															ngController     : ngController,
															ngCsp            : ngCsp,
															
															ngDblClick       : ngDblClick,
															
															
															ngDisabled       : ngDisabled,
															ngForm           : ngForm,
															ngHide           : ngHide,
															ngHref           : ngHref,
															ngInclude        : ngInclude,
															ngInit           : ngInit,
															ngList           : ngList,
															ngModel          : ngModel,
															ngMousedown      : ngMousedown,
															ngMouseenter     : ngMouseenter,
															ngMouseleave     : ngMouseleave,
															ngMousemove      : ngMousemove,
															ngMouseover      : ngMouseover,
															ngMouseup        : ngMouseup,
															ngMultiple       : ngMultiple,
															ngNonBindable    : ngNonBindable,
															ngPluralize      : ngPluralize,
															ngReadonly       : ngReadonly,
															ngRepeat         : ngRepeat,
															ngSelected       : ngSelected,
															ngShow           : ngShow,
															ngSrc            : ngSrc,
															ngStyle          : ngStyle,
															ngSubmit         : ngSubmit,
															ngSwitch         : ngSwitch,
															ngTransclude     : ngTransclude,
															ngView           : ngView

																		
																	])
	}

	
	def link = { attrs, body ->
		def theme = attrs.theme ? "/themes/${attrs.theme}" : "/themes/default";
		
		def htmlId   = attrs.htmlId;
		def cssClass = attrs.cssClass;
		
		def href     = attrs.href;		
		def icon     = attrs.icon;
		
		def ngBind           = attrs.ngBind;
		def ngBindHtmlUnsafe = attrs.ngBindHtmlUnsafe;
		def ngBindTemplate   = attrs.ngBindTemplate;
		def ngChange         = attrs.ngChange;
		def ngClass          = attrs.ngClass;
		def ngClassEven      = attrs.ngClassEven;
		def ngClassOdd       = attrs.ngClassOdd;
		def ngClick          = attrs.ngClick;
		
		def ngController     = attrs.ngController;				
		def ngCsp            = attrs.ngCsp;
		
		def ngDblClick       = attrs.ngDblClick;
		
		
		def ngDisabled       = attrs.ngDisabled
		def ngForm           = attrs.ngForm
		def ngHide           = attrs.ngHide
		def ngHref           = attrs.ngHref;
		def ngInclude        = attrs.ngInclude
		def ngInit           = attrs.ngInit
		def ngList           = attrs.ngList
		def ngModel          = attrs.ngModel
		def ngMousedown      = attrs.ngMousedown
		def ngMouseenter     = attrs.ngMouseenter
		def ngMouseleave     = attrs.ngMouseleave
		def ngMousemove      = attrs.ngMousemove
		def ngMouseover      = attrs.ngMouseover
		def ngMouseup        = attrs.ngMouseup
		def ngMultiple       = attrs.ngMultiple
		def ngNonBindable    = attrs.ngNonBindable
		def ngPluralize      = attrs.ngPluralize
		def ngReadonly       = attrs.ngReadonly
		def ngRepeat         = attrs.ngRepeat
		def ngSelected       = attrs.ngSelected
		def ngShow           = attrs.ngShow
		def ngSrc            = attrs.ngSrc
		def ngStyle          = attrs.ngStyle
		def ngSubmit         = attrs.ngSubmit
		def ngSwitch         = attrs.ngSwitch
		def ngTransclude     = attrs.ngTransclude
		def ngView           = attrs.ngView
		
		
		def angularjs = render(template: "${theme}/ui/angularAttrs", model: [														
															
															ngBind           : ngBind,
															ngBindHtmlUnsafe : ngBindHtmlUnsafe,
															ngBindTemplate   : ngBindTemplate,
															ngChange         : ngChange,
															ngClass          : ngClass,
															ngClassEven      : ngClassEven,
															ngClassOdd       : ngClassOdd,
															ngClick          : ngClick,
															
															ngController     : ngController,
															ngCsp            : ngCsp,
															
															ngDblClick       : ngDblClick,
															
															
															ngDisabled       : ngDisabled,
															ngForm           : ngForm,
															ngHide           : ngHide,
															ngHref           : ngHref,
															ngInclude        : ngInclude,
															ngInit           : ngInit,
															ngList           : ngList,
															ngModel          : ngModel,
															ngMousedown      : ngMousedown,
															ngMouseenter     : ngMouseenter,
															ngMouseleave     : ngMouseleave,
															ngMousemove      : ngMousemove,
															ngMouseover      : ngMouseover,
															ngMouseup        : ngMouseup,
															ngMultiple       : ngMultiple,
															ngNonBindable    : ngNonBindable,
															ngPluralize      : ngPluralize,
															ngReadonly       : ngReadonly,
															ngRepeat         : ngRepeat,
															ngSelected       : ngSelected,
															ngShow           : ngShow,
															ngSrc            : ngSrc,
															ngStyle          : ngStyle,
															ngSubmit         : ngSubmit,
															ngSwitch         : ngSwitch,
															ngTransclude     : ngTransclude,
															ngView           : ngView
													
														   ])
        
		
		//def angularjs = "";
		out << render(template: "${theme}/ui/link", model: [
															id: htmlId,
															cssClass: cssClass,
															
															href : href,
															
															icon : icon,
															text : body,
															
															angularjs : angularjs
																												
														   ])
	}

	
	
	
	
    def composition = { attrs, body ->
        if (!attrs.template) {
            throwTagError("Tag [composition] is missing required attribute [template]")
        }
        
		common.ui.components.ContainerView composition = new common.ui.components.ContainerView()
		
        body(composition: composition)
		
		
        out << " <div> Template: ${attrs.template}, child: ${composition.defines} </div>" //g.render(template: attrs.template, model: composition.defines)
    }

    def define = { attrs, body ->
        //if (!attrs.composition) {
        //    throwTagError("Tag [define] is missing required attribute [composition]")
        //}
        //if (!attrs.name) {
        //    throwTagError("Tag [define] is missing required attribute [name]")
        //}
		if (!attrs.composition) {
			attrs.composition = this.pageScope.composition
		}	
		
        attrs.composition.defines.put(attrs.name, body)
    }
	
}
